package cn.gzsxt.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface DictionaryMapper {
	
	/**
	 * 通过类型编码找到，该类型字典值的所有数据
	 * @param typeCode
	 * @return
	 */
	@Select("SELECT * FROM tb_dictionary WHERE DICTIONARY_TYPE_CODE=#{typeCode}")
	List<Map<String, Object>> findByTypeCode(Object typeCode);
	
	/**
	 * 通过字典类型以及字典值获得字典数据
	 * @param typeCode
	 * @param value
	 * @return
	 */
	@Select("SELECT * FROM tb_dictionary WHERE DICTIONARY_TYPE_CODE=#{typeCode} AND DICTIONARY_VALUE=#{value}")
	Map<String, Object> findByTypeCodeAndValue(@Param("typeCode") Object typeCode,@Param("value")Object value);

}
